package gui.customComponents;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.Border;

public class GTTabPanel extends JPanel {

	public final int topgap = 6;
	public final int leftgap = 8;
	public final int bottomgap = 15;
	public final int rightgap = 8;
	
	public void GTPanel(){
		// background color to white
		setBackground( null );
		// set border to MatteBorder(15, 15, 15, 15, new Color(232,232,232)));
		setBorder( null ); // this is overwrote
	}
	
	/**overwrote method*/
	public void setBackground(Color color){
		super.setBackground( Color.white );		
	}
	
	/**overwrote method*/
	public void setBorder(Border border){
		super.setBorder( BorderFactory.createMatteBorder( topgap, leftgap, bottomgap, rightgap, Color.white));
	}
	
	private Object[][] tabinfo = { { "Console", null, true}  };
	
	public void paint(Graphics g){
		
		g.setColor(new Color(232,232,232));
		g.fillRect(0, 0, this.getWidth(), this.getHeight() );
		
		super.paint(g);
			
		
		//g.setColor( Color.white );
		//g.fillRoundRect(0, 0, this.getWidth()-2, this.getHeight()-2, 14, 14);
		g.setColor( new Color(196, 197, 193));
		g.drawRoundRect(1, 0, this.getWidth()-3, this.getHeight()-4, 14, 14);
		
		// fill topleft corner (from white to color(232,232,232))
		g.setColor(new Color(232,232,232)  );
		g.drawLine(0, 0, 5, 0);
		g.drawLine(0, 1, 3, 1);
		g.drawLine(0, 2, 2, 2);
		g.drawLine(1, 0, 1, 4);
		g.drawLine(0, 0, 0, 5);
		// fill topright corner (from white to color(232,232,232))
		g.setColor(new Color(232,232,232)  );
		g.drawLine(this.getWidth()-6, 0, this.getWidth()-1, 0 );
		g.drawLine(this.getWidth()-4, 1, this.getWidth()-1, 1 );
		g.drawLine(this.getWidth()-3, 2, this.getWidth()-1, 2 );
		g.drawLine(this.getWidth() - 2, 3, this.getWidth() - 1, 3);
		g.drawLine(this.getWidth() - 2, 4, this.getWidth() - 1, 4);
		// fill low right corner (from white to color(217,217,217))
		g.setColor(new Color(217,217,217));
		g.drawLine(this.getWidth() - 6, this.getHeight()-4, this.getWidth() - 1, this.getHeight()-4);
		g.drawLine(this.getWidth() - 4, this.getHeight()-5, this.getWidth() - 1, this.getHeight()-5);
		g.drawLine(this.getWidth() - 3, this.getHeight()-6, this.getWidth() - 1, this.getHeight()-6);
		g.drawLine(this.getWidth() - 2, this.getHeight()-7, this.getWidth() - 1, this.getHeight()-7);
		g.drawLine(this.getWidth() - 2, this.getHeight()-8, this.getWidth() - 1, this.getHeight()-8);
		// fill the low left corner
		g.setColor(new Color(217,217,217));
		g.drawLine(0, this.getHeight()-4, 5, this.getHeight()-4);
		g.drawLine(0, this.getHeight()-5, 3, this.getHeight()-5);
		g.drawLine(0, this.getHeight()-6, 2, this.getHeight()-6);
		g.drawLine(1, this.getHeight()-4, 1, this.getHeight()-8);
		g.drawLine(0, this.getHeight()-4, 0, this.getHeight()-9);
		
		// shadows: left
		g.setColor( new Color(221,221,221));
		g.drawLine( 0, 5, 0, this.getHeight()-4);
		// shadows: right
		g.setColor( new Color(221,221,221));
		g.drawLine( this.getWidth()-1, 5, this.getWidth()-1, this.getHeight()-4);
		g.setColor( new Color(225,225,225));
		g.drawLine( this.getWidth(), 5, this.getWidth(), this.getHeight()-4);
		// shadows: bottom
		g.setColor( new Color(217,217,217));
		g.drawLine( 0, this.getHeight() - 3, this.getWidth(), this.getHeight() - 3 );
		g.setColor( new Color(221,221,221));
		g.drawLine( 0, this.getHeight() - 2, this.getWidth(), this.getHeight() - 2 );
		g.setColor( new Color(225,225,225));
		g.drawLine( 0, this.getHeight() - 1, this.getWidth(), this.getHeight() - 1 );
		g.setColor( new Color(228,228,228));
		g.drawLine( 0, this.getHeight(), this.getWidth(), this.getHeight() );

		//Graphics2D g2 = (Graphics2D) g;
		//Paint paint = 
		//g2.setPaint(paint);
		
		//this.repaint(1, 10, 10, this.getWidth()-10, this.HEIGHT-10);
		
	}
}
